import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'

Vue.use(VueRouter)

const routes = [{ //首页
        path: '/',
        name: 'Index',
        meta: {
            title: "会飞的鱼"
        },
        component: Index
    },
    { //登录
        path: '/login',
        name: 'Login',
        meta: {
            title: "登录--会飞的鱼"
        },
        component: () =>
            import ('../views/Login.vue')
    },
    { //注册
        path: '/register',
        name: 'Register',
        meta: {
            title: "注册--会飞的鱼"
        },
        component: () =>
            import ('../views/Register.vue')
    },
    { //修改密码
        path: "/revisePsw",
        name: 'RevisePsw',
        meta: {
            title: "修改密码--会飞的鱼"
        },
        component: () =>
            import ('../views/RevisePsw.vue')
    },
    { //用户协议
        path: '/agreement',
        name: 'Agreement',
        meta: {
            title: "协议--会飞的鱼"
        },
        component: () =>
            import ('../views/Agreement.vue')
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router